<%@ page language="java" pageEncoding="utf-8" %>
<%@ include file="/include/taglibs.jsp" %>

<script src="${path}/static/bootstrap/bootstrap-table/bootstrap-table.js"></script>
<script src="${path}/static/system/push/pushindex.js"></script>
<link rel="stylesheet" href="${path}/static/css/public/public.css">
<link href="${path}/static/css/public/public.css" rel="stylesheet" type="text/css">

<div class="col-xs-1">
    <button type="button" class="btn btn-default-button entry" id="addPushMsg" style="background-color: #3c8dbc;color: snow">
        推送信息
    </button>
</div>
<div class="col-xs-2">
    <input type="text" class="form-control entry" placeholder="请输入标题" name="tuisongtitle"/>
</div>

<div class="col-xs-2">
    <input type="text" class="form-control rangedate entry" placeholder="请输入推送时间" name="tuisongtime"/>
</div>
<div class="col-xs-2">
    <select name="tuisongren" class="form-control entry">
        <option value="">-选择推送类型-</option>
        <option value="1">别名</option>
        <option value="2">标签</option>
        <option value="3">全部</option>
    </select>
</div>
<button class="btn query_button" id="tuisongSear">
    <%--<span class="glyphicon glyphicon-search" aria-hidden="true"></span>--%>
    查询
</button>


<table id="table"
       class="table table-striped table-bordered"
       data-toggle="table"
       data-toolbar="#toolbar"
       data-url="${path}/web/push/pushQuery"
       data-side-pagination="server"
       data-pagination="true"
       data-page-list="[5, 10, 20, 50, 100, 200]">
    <thead>
    <tr>
        <th data-field="title">标题</th>
        <th data-field="users" data-formatter="typeFormatter">类型</th>
        <th data-field="users">被推送人</th>
        <th data-field="createTime">时间</th>
        <th data-formatter="operateFormatter" data-events="operateEvents">操作</th>
    </tr>
    </thead>
</table>


<div id="addPushmsg-div" class="slidingmenu box-model box box-info" model-width="50%" model-left="50%"><!--添加推送信息 開始-->
    <div class="box box-info">
        <div class="box-header">
            <h3 class="box-title">推送信息</h3>
        </div>
        <div class="box-body">
            <form role="form" method="post" id="pushmsgform">

                <div class="form-group">
                    <label>标题:</label>
                    <input type="text" class="form-control" name="title" placeholder="请输入标题"  style="width: 70%;">
                </div>

                <div class="form-group">
                    <label>摘要(手机端显示):</label>
                    <input type="text" class="form-control" name="remark" placeholder="请输入摘要" style="width: 70%;">
                </div>

                <div class="form-group">
                    <label>图片:</label>

                    <div class="container">
                        <input type="hidden" name="picture" value="" alt="图片路径">
                        <img id="addImage1" class="addImage" src="${path}/static/images/commons/img_add.png"
                             height="150px">
                    </div>
                    <div style="color:red;margin-top:10px;margin-bottom: 10px">推荐上传图片为800 x 800以上分辨率的图片</div>
                </div>

                <div class="form-group">
                    <label>发布信息:</label>
                    <textarea name="content" hidden="hidden" id="content"></textarea>
                    <script class="editor" id="editor" type="text/plain"
                            style="width:700px;height:200px;"></script>
                </div>

                <div class="form-group">
                    <label>推送类型：</label>
                    <div class="radio-inline">
                        <label>
                            <input type="radio" name="pushType" value="0"/>
                            别名
                        </label>
                    </div>
                    <div class="radio-inline">
                        <label>
                            <input type="radio" name="pushType" value="1"/>
                            标签推送
                        </label>
                    </div>
                    <div class="radio-inline">
                        <label>
                            <input type="radio" checked="checked" name="pushType" value="2"/>
                            全部
                        </label>
                    </div>
                </div>

                <div class="form-group" id="div-tags" style="display: none">
                    <div class="form-group">
                        <label>推送对象：</label>
                    </div>
                    <div class="form-inline">
                        <div class="checkbox">
                            <label><input name="tags" type="checkbox" id="tags1"/>用户端</label>
                        </div>
                        <div class="checkbox">
                            <label><input name="tags" type="checkbox" id="tags2"/>商家端</label>
                        </div>
                        <div class="checkbox">
                            <label><input name="tags" type="checkbox" id="tags3"/>配送端</label>
                        </div>
                    </div>
                </div>

                <div class="form-group" id="div-alias" style="display: none">
                    <div class="form-group">
                        <label>推送对象：</label>
                    </div>
                    <div class="form-group">
                        <textarea name="users" style="width: 70%;" class="form-control"
                                  placeholder="请输入手机号(多个手机号可以用','分割，最多50个手机号)"></textarea>
                    </div>
                </div>
            </form>
            <div class="box-footer">
                <button class="btn btn-info" data-event="submit-savepushmsg">保存</button>
                &nbsp;
                <button class="btn btn-danger close-model">关闭</button>
            </div>
        </div>
        <!-- /.box-body -->
    </div>
</div>
<!--添加信息 结束-->
<div id="findpushmsg-div" class="slidingmenu box-model box box-info"><!--查看推送信息 開始-->
    <div class="box box-info">
        <div class="box-header">
            <h3 class="box-title">查看</h3>
        </div>
        <div class="box-body">
            <form role="form" method="post" id="pushform">
                <div class="form-group col-xs-8">
                    <label>标题:</label>
                    <input type="text" class="form-control" id="title" readonly>
                </div>

                <div class="form-group col-xs-8">
                    <label>摘要:</label>
                    <input type="text" class="form-control" id="remark" readonly>
                </div>

                <div class="form-group col-xs-8">
                    <label>展示图片:</label>
                    <div><img id="picture" src="${path}/static/images/commons/img_add.png" style="height:170px;" onclick="enlargeImage(this)"></div>
                </div>
                <div class="form-group col-xs-12">
                    <label>发布信息:</label>
                    <div id="content1">

                    </div>
                </div>
            </form>
            <div class="box-footer col-xs-12">
                <button class="btn btn-danger close-model">关闭</button>
            </div>
        </div>
        <!-- /.box-body -->
    </div>
</div>

<script>
    var editor = UE.getEditor('editor');
</script>

                    <div id="detailImage-div" style="z-index:999"  class="slidingmenu box-model box box-info">
                        <div class="box box-info">
                            <div class="box-body">
                                <div class="form-group">
                                    <div id="image" style="margin-top: 5%">

                                    </div>
                                </div>
                                <div class="box-footer">
                                    <button class="btn btn-danger close-model">关闭</button>
                                </div>
                            </div><!-- /.box-body -->
                        </div>
                    </div>